/*
 * @Description:
 * @Author: hanyu
 * @Date: 2020-03-16 14:08:05
 * @LastEditTime: 2022-03-02 16:54:30
 * @LastEditors: hanyu
 */
import Cookies from 'js-cookie';
export const TOKEN_KEY = 'kf-ff-token'; // zr-lecturer-user-token

export default {
  setToken: token => {
    Cookies.set(TOKEN_KEY, token, {
      // token在Cookie中存储的天数，默认1天
      expires:  7
    });
  },
  getToken: () => {
    const token = Cookies.get(TOKEN_KEY);
    if (token) return token;
    else return null;
  },
  clearToken: () => {
    Cookies.remove(TOKEN_KEY);
  }
};
